#include <stdio.h>
#include <stdlib.h>

struct Node{
    int value;
    struct Node *next;
};

struct Node*arrayToLinkedList(int arr[],int size){
    if (size==0) return NULL;
    int visited[size];
    struct Node *head, *tail;
    head=tail=NULL;
    for (int i=0;i<size;i++){visited[i]=0;}
    for (int i=0;i<size;i++){
        int count;
        for (int j=0;j<size;j++){
            if (visited[j]==0){
                count=j;
                break;
            }
        }
        for (int j=count;j<size;j++){
            if (!visited[j]&&arr[j]<arr[count]){count=j;}
        }
        visited[count]=1;
        struct Node *newNode=(struct Node*)malloc(sizeof(struct Node));
        newNode->value=arr[count];
        newNode->next=NULL;
        if (head==NULL){
            head=newNode;
            tail=head;
        }
        else{
            tail->next=newNode;
            tail=newNode;
        }
    }
    return head;
}

int main(){
    char buffer[1000];
    fgets(buffer, sizeof(buffer),stdin);
    int numbers[100];
    int size=0;
    char *ptr=buffer;
    while (sscanf(ptr,"%d",&numbers[size])==1){
        size++;
        while ('0'<=*ptr&&*ptr<='9'){
            //printf("%c",*ptr);
            ptr++;
        }
        while (*ptr==' '){
            ptr++;
        }
        if (*ptr=='\n'||*ptr=='\0'){break;}
    }
    struct Node *node=arrayToLinkedList(numbers,size);
    while (node!=NULL){
        printf("%d",node->value);
        node=node->next;
        if (node!=NULL){printf(" -> ");}
    }
    printf("\n");
}